import { ServerEventListener } from "@/pages/room/ws/ws.ts";
import { ReactiveData } from "@/pages/room/model.ts";


export function createVideoChangeListener(
    data: ReactiveData,
    triggerAfter: () => void
): ServerEventListener<"video.change"> {
    return function (details) {
        if (data.room?.video) {
            data.room.video.url = details.url;
            triggerAfter();
        }
    }
}